import React, { memo, useState,useEffect } from 'react'

const App = memo(() => {
  const [counter, setCounter] = useState(100)
  const [message, setMessage] = useState('hello world');

  function changTitle () {
    setCounter(counter + 1)
  }
  useEffect(() => {
    document.title = counter
    console.log('修改title');
  }, [counter])
  useEffect(() => {
    console.log('监听redux 数据');
  }, )
  useEffect(() => {
    console.log('其它数据监听');
    return () => {
      
    };
  }, []);
  return (
    <div>
      <h1>App： counter-{counter}</h1>
      <button onClick={() => changTitle()}>+1</button>
      <p>{message}</p>
      <button onClick={()=>setMessage('张楚岚')}>修改文本</button>
    </div>
  )
})

export default App